
<html>
    <head>
        <script type="text/javascript"
        src="https://code.jquery.com/jquery-3.4.0.min.js"></script>
        <script type="text/javascript"
        src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>

        <script type="text/javascript" charset="utf-8">
            $(document).ready(function () {
                namespace = "/wechat"
                var socket = io.connect('http://' + document.domain + ':' + location.port + namespace);

                socket.emit("message", { "data": "zhangsan" })

                socket.on('connect', function (data) {
                    socket.emit('message', { 'data': 'I\'m connected!' });
                });

                socket.on('disconnect', function(data){
                    socket.emit('message', { 'data': 'I\'m disconnected!' });
                });

                socket.on('response', function (data) {
                    console.log(data.age)
                });
            });
        </script>
    </head>

    <body>
        <h1>德玛西亚</h1>
    </body>
</html>


